
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>My JSP 'updateUser.jsp' starting page</title>
		<script type="text/javascript" src="../../js/include.js"></script>
		<script type="text/javascript">
			function submitForm(){
				if($("#ff").form('validate')==true){
					$.ajax({   
					     url:orderUrl+"/order/products/update",
					     type:$("#ff").attr("method"),   
					     data:$("#ff").serializeArray(),
					     success:function(data){   
					    	 if(data.result=="success"){
					        	 toList();
					        }else{
					        	$.messager.alert('提示',data.msg);
					        }
					     }
					});
				}
			}
			function toList(){
				window.location=htmlURL+"/order/products/list.html";
			}
			$(function(){

				$.ajax({
					 url:orderUrl+'/order/products/selectByPrimaryKey',
					 type:'get',
					 data:'id='+getQueryString("id"),
					 success:function(data){
						var v=data.data;
						$('#ff').form('load',v);
						var s= new Array();
						for(var i=0;i<v.userRoleList.length;i++){
							s.push(v.userRoleList[i].roleId);
						}
						$('#cc').combobox('setValues',s);
					 }
				});

			})
		</script>
	</head>

	<body>
		<form id="ff" method="POST">
			<input type="hidden" id="id" name="id" value="">
			<table>
				<tr>
					<td>商品:</td>
					<td><input type="text" name="name" class="easyui-textbox" required="true" validType="length[1,25]"></td>
				</tr>
				<tr>
					<td>库存:</td>
					<td><input type="text"  name="stock" class="easyui-textbox" required="true" validType="length[1,25]"></td>
				</tr>
				<tr>
					<td>价格:</td>
					<td><input type="text"  name="amount" class="easyui-textbox" required="true" validType="length[1,25]"></td>
				</tr>

			</table>
		</form>
		<div id="dlg-buttons">
			<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">保存</a>
			<a href="javascript:void(0)" class="easyui-linkbutton"  onclick="toList()">返回</a>
		</div>
		
	</body>
</html>
